package experiment;
import java.util.Scanner;
public class Circle {
    private double radius;
    private String color;

    public double getRadius(){
        return radius;
    }
    public void setRadius(double radius) {
        this.radius = radius;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public Circle(){
        this.radius=0;
    }

    public double getArea()//求圆的面积
    {
        double radius1=this.radius;
        return radius1*radius1*3.14;
    }
    public double getPerimeter() {//求圆的周长
        return this.radius * 3.14 * 2;
    }
    public void show() {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入半径:");
        this.setRadius(sc.nextInt());
        System.out.println("半径="+this.getRadius());
        System.out.println("周长"+this.getPerimeter());
        System.out.println("面积"+this.getArea());
    }
    public static void main(String args[]) {
        Circle c=new Circle();
        c.show();
    }

}
